package com.example.service.impl;

import com.example.dao.BookDao;
import com.example.entity.Book;
import com.example.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookDao bookDao;

    @Override
    public int insertBook(Book book) {
        return bookDao.insert(book);
    }

    @Override
    public Book queryBookById(int id) {
        return bookDao.queryById(id);
    }

    @Override
    public int deleteBook(int id) {
        return bookDao.delete(id);
    }

    @Override
    public int updateBook(Book book) {
        return bookDao.update(book);
    }
}
